package com.xdkj.es.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @author joke
 * @version 1.0
 * @date 2021/12/18-14:10
 * createIndex true 没有索引就会自己创建索引
 */
@Document(indexName = "ego", shards = 5, replicas = 1, createIndex = false)
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Goods implements Serializable {

    private static final long serialVersionUID = -2686837293740918416L;
    /**
     * 商品id
     */
    @Id
    private Integer goodsId;
    /**
     * 商品名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goodsName;
    /**
     * 商品价格
     */
    @Field(type = FieldType.Double)
    private BigDecimal marketPrice;
    /**
     * 原始img
     */
    @Field(type = FieldType.Keyword)
    private String originalImg;
}
